home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Why NULL
- Sent: 5/23/96 9:52 PM
- Received: 5/24/96 8:49 AM
- From: Jim Lloyd, jim@melongem.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- At 7:23 PM 5/23/96, Serge Froment wrote:
- >Dear ODF Team:
- >
- >Why does ODF defines a NULL macro instead of using C++'s nil? I
- >suppose there is a good reason, but I cannot figure it out...
- >
- >Serge
-
- Damon beat me to it, but I'll add my two bits anyway. The proposed ANSI/ISO
- specification for C++ does not define "nil" anywhere. It does define NULL,
- as a macro, but only as a concession for compatibility with C. The macro
- should be simply:
-
- #define NULL 0
-
- Note that it should NOT be any of the following:
-
- #define NULL ((void*)0)
- #define NULL 0L
-
- This is due to the fact that the specification says that only 0 can be
- implicitly converted to a pointer to any type T*. There is a significant
- minority of people in the C++ community that believe that NULL should be
- deprecated, and 0 always used instead.
-
- Jim Lloyd
-
-
-
-